package com.airlines.system.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import com.airlines.system.domain.SysFunction;
import com.airlines.system.domain.SysMenu;

import java.util.List;

@Mapper
public interface SysFunctionMapper {

    int deleteByPrimaryKey(String id);

    int insert(SysFunction record);

    int insertSelective(SysFunction record);

    SysFunction selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(SysFunction record);

    int updateByPrimaryKey(SysFunction record);

    /**查找某一个角色所有的功能*/
    @Select("SELECT * from T_SYS_FUNCTION  where  ID  in (SELECT rf.FUNC_ID from T_SYS_ROLE_FUNCTION rf where rf.ROLE_ID = #{roleId} ) and STATUS='1'")
    @ResultMap("com.airlines.system.dao.SysFunctionMapper.BaseResultMap")
    List<SysFunction> findByRoleId(@Param("roleId") String roleId);
}